/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.ohyessoftware.sigc.infra.negocio;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/**
 * Classe de negocio cargo
 * @author Diego
 * 01/06/2011
 */
@Entity
@Table(name = "cargo", schema = "sigc")
public class Cargo implements Serializable {

    private static final long serialVersionUID = 1L;

    //atributos
    /******************************************************************************/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "cod_cargo")
    private Long codCargo;

    @Column(name = "nome")
    private String nome;

    @Column(name = "descricao")
    private String descricao;

    //relacoes
    /******************************************************************************/
    @OneToMany(mappedBy = "cargo", fetch = FetchType.LAZY)
    private List<Funcionario> funcionario;

    //get e set
     /******************************************************************************/
    public Long getCodCargo() {
        return codCargo;
    }

    public void setCodCargo(Long codCargo) {
        this.codCargo = codCargo;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public List<Funcionario> getFuncionario() {
        return funcionario;
    }

    public void setFuncionario(List<Funcionario> funcionario) {
        this.funcionario = funcionario;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }


}
